from typing import Optional

from sqlalchemy import PrimaryKeyConstraint, String, Text
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column

class Base(DeclarativeBase):
    pass


class Dogs(Base):
    __tablename__ = 'dogs'
    __table_args__ = (
        PrimaryKeyConstraint('dog_code', name='dogs_pkey'),
    )

    dog_code: Mapped[str] = mapped_column(String(50), primary_key=True, comment='编号')
    video_url: Mapped[Optional[str]] = mapped_column(Text, comment='视频流链接')
    ip_address: Mapped[Optional[str]] = mapped_column(String(50), comment='IP地址')
